package com.lc.recovery.ui.activity.warehousemine;

import android.os.Bundle;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallback;
import com.lc.recovery.R;
import com.lc.recovery.app.AppActivity;
import com.lc.recovery.http.request.StorageOutShowApi;
import com.lc.recovery.http.response.StorageOutShowBean;
import com.lc.recovery.http.response.WorkerStockShowBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class StorageOutDetailsActivity extends AppActivity {


    @BindView(R.id.tv_date)
    TextView tvDate;
    @BindView(R.id.tv_type)
    TextView tvType;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_weight)
    TextView tvWeight;
    @BindView(R.id.tv_personnel)
    TextView tvPersonnel;
    @BindView(R.id.tv_chae)
    TextView tvChae;
    @BindView(R.id.tv_shifu)
    TextView tvShifu;
    private List<WorkerStockShowBean.DataBean> dataBeanList = new ArrayList<>();
    private BaseQuickAdapter<WorkerStockShowBean.DataBean, BaseViewHolder> alreadywarehousingsadapter;
    private String shop_id;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_storageoutdetails;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);

        shop_id = getIntent().getStringExtra("id");
        workerStockShow();

    }

    private void workerStockShow() {

        EasyHttp.post(this)
                .api(new StorageOutShowApi().setId(shop_id)).request(new HttpCallback<StorageOutShowBean>(this) {

            @Override
            public void onSucceed(StorageOutShowBean data) {
                if (data.getCode() == 200) {
                   tvType.setText(data.getData().getShops());
                    tvDate.setText(data.getData().getCreate_time());
                    tvPersonnel.setText(data.getData().getStorager());
                    tvWeight.setText(data.getData().getWeights());

                } else {
                    toast(data.getMsg());
                }
            }


            @Override
            public void onFail(Exception e) {
                super.onFail(e);

            }
        });
    }

}